#if !defined(AFX_CLIENTSOCKET_H__DF5FC080_3663_46D4_8547_78D948BA965F__INCLUDED_)
#define AFX_CLIENTSOCKET_H__DF5FC080_3663_46D4_8547_78D948BA965F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ClientSocket.h : header file
//



/////////////////////////////////////////////////////////////////////////////
// CClientSocket command target

class Packet;

class CClientSocket : public CAsyncSocket
{
// Attributes
public:
  LPBYTE m_lpbySendBuf;
  int m_nSendDataLen;
  int m_nBytesSent;

  LPBYTE m_lpbyRecvBuf;
  int m_nRecvDataLen;
  int m_nBytesRecv;

  int m_nRecvStatus;
  enum {RecvId, RecvLength, RecvData};

  DWORD m_dwId;
  DWORD m_dwDataSize;

// Operations
public:
	CClientSocket();
	virtual ~CClientSocket();

  void Init();
	void AsyncSend(Packet * pPacket);

// Overrides
public:
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CClientSocket)
	public:
	virtual void OnClose(int nErrorCode);
	virtual void OnReceive(int nErrorCode);
	virtual void OnSend(int nErrorCode);
	virtual void OnConnect(int nErrorCode);
	//}}AFX_VIRTUAL

	// Generated message map functions
	//{{AFX_MSG(CClientSocket)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

// Implementation
protected:
  void DoAsyncSend();
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CLIENTSOCKET_H__DF5FC080_3663_46D4_8547_78D948BA965F__INCLUDED_)
